import { createBrowserRouter, Navigate } from "react-router-dom";


import Login from "../pages/login";
import NotFound from '../pages/notFound'
import Layout  from "@/pages/layout";
import Register from "../pages/register";
import Main from "../pages/main";
import Home from "../pages/home"
import Profile from "../pages/profile";
import TorrentList from "../pages/torrentList";

const router = createBrowserRouter([
    
    {
        path: '/login',
        element: <Login/>
    },
    {
        path: '/register',
        element: <Register/>
    },
    {
        path: '/profile',
        element: <Profile/>
    },
    {
        path:'/torrentList',
        element:<TorrentList/>
    },
    {
        path: "/",
        Component: Main,
        children: [
            {
                path: "/",
                element: <Navigate to="home" replace/>
            },
            {
                path: "home",
                Component: Home
            }
        ]
    },
    {
        path:'*',
        element:<NotFound/>
    }
])

export default router